<!DOCTYPE html>
<html>
<head>
    <title>WebSocket Test</title>
</head>
<body>
<h1>WebSocket Test</h1>
<input type="text" id="message" placeholder="Type your message">
<button onclick="sendMessage()">Send</button>
<div id="output"></div>

<script>
        const socket = new WebSocket("ws://localhost:8080/ws");

        socket.onmessage = function(event) {
            const output = document.getElementById("output");
            output.innerHTML += "<p>" + event.data + "</p>";
        };

        function sendMessage() {
            const message = document.getElementById("message").value;
            socket.send(message);
        }
    </script>
</body>
</html>
